package com.zmn.brs.services.impl.objective.record;

import com.zmn.brs.model.entity.objective.record.ObjectiveRecord;
import com.zmn.brs.model.entity.objective.record.ObjectiveRecordQuery;
import com.zmn.brs.model.query.record.ObjectiveRecordCustomDIO;
import com.zmn.brs.persistence.interfaces.objective.record.ObjectiveRecordDao;
import com.zmn.brs.services.interfaces.objective.record.ObjectiveRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;



@Service
public class ObjectiveRecordServiceImpl implements ObjectiveRecordService {

    @Resource
    ObjectiveRecordDao objectiveRecordDao;

    @Override
    public ObjectiveRecord findByKey(Integer id) {
        return objectiveRecordDao.findByKey(id);
    }

    @Override
    public List<ObjectiveRecord> listPageByQuery(ObjectiveRecordQuery query) {
        int count = countByQuery(query);
        query.setTotalCount(count);
        return objectiveRecordDao.listPageByQuery(query);
    }

    @Override
    public List<ObjectiveRecord> listByQuery(ObjectiveRecordQuery query) {
        return objectiveRecordDao.listByQuery(query);
    }

    /**
     * 查询当前员工数据
     * @param query
     * @return
     */
    @Override
    public List<ObjectiveRecordCustomDIO> listObjectiveRecordByQuery(ObjectiveRecordQuery query){
        return objectiveRecordDao.listObjectiveRecordByQuery(query);
    }

    @Override
    public List<ObjectiveRecord> listAll() {
        return objectiveRecordDao.listAll();
    }

    @Override
    public Integer countByQuery(ObjectiveRecordQuery query) {
        return objectiveRecordDao.countByQuery(query);
    }
    @Override
    public Integer updateStatusByKey(ObjectiveRecord objectiveRecord) {
        return objectiveRecordDao.updateStatusByKey(objectiveRecord);
    }

    @Override
    public Integer updateStatusBatchByKey(List<Integer> ids, Integer status, String mcStaffName) {
        return objectiveRecordDao.updateBatchStatusByKey(ids, status, mcStaffName);
    }
    @Override
    public Integer updateByKey(ObjectiveRecord objectiveRecord) {
        return objectiveRecordDao.updateByKey(objectiveRecord);
    }

    @Override
    public Integer insert(ObjectiveRecord objectiveRecord) {
        return objectiveRecordDao.insert(objectiveRecord);
    }

    @Override
    public Integer deleteByKey(Integer id) {
        return objectiveRecordDao.deleteByKey(id);
    }

}